/*
 * Copyright 2009-2015 by WWW.KNET.CN  All rights reserved.
 */

package cn.knet.sp.ncrm.modules.call.reportin.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import org.hibernate.validator.constraints.Length;

import java.util.Date;

import javax.validation.constraints.NotNull;

import cn.knet.sp.ncrm.common.persistence.DataEntity;
import cn.knet.sp.ncrm.modules.sys.office.entity.Office;
import cn.knet.sp.ncrm.modules.sys.user.entity.User;

/**
 * 呼入统计
 * @author zhangbin
 * @version 2015 -07-02
 */
public class CallReportIn extends DataEntity<CallReportIn> {

	private static final long serialVersionUID = 1L;
	private Date statDate;        // 统计时间
	private User user;        // NCM人员ID
	private String userName;        // NCM人员姓名
	private Office office;        // NCRM组织机构ID
	private String callingId;        // 呼叫中心坐席ID
	private String serviceId;        // 呼叫中心服务ID
	private String vccid;        // 呼叫中心企业ID
	private Long busyTime;        // 示忙时长
	private Long freeTime;        // 示闲时长
	private Long callCount;        // 请求呼入量
	private Long callTime;        // 总通话时长(应答时长+振铃时长)
	private Long successCallCount;        // 呼通量
	private Long successCallTime;        // 应答时长
	private Double successCallRate;        // 接起率(呼通量/呼入量)
	private Long callTimeAvg;        // 平均通话时长(通话时长/呼通量)
	private Long successCallTimeAvg;        // 平均应答时长(应答时长/呼入量)
	private Long ringTime;        // 振铃时长
	private Long ringCount;        // 振铃次数
	private Long ringAvgTime;        // 平均振铃时长(振铃时长/振铃次数)
	private Long callMaxTime;        // 最长通话时长
	private Long callQuickCount;        // 快速接通次数
	private Long callLongCount;        // 长通话次数
	private Long queueTime;        // 排队时长
	private Long sCalled;        // 坐席挂机次数
	private Long cCalled;        // 客户挂机次数
	private String statType;        // 统计类型1全时间统计2工作时间统计

	private String shortId;		//工号

	public CallReportIn() {
		super();
	}

	public CallReportIn(String id) {
		super(id);
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message = "统计时间不能为空")
	public Date getStatDate() {
		return statDate;
	}

	public void setStatDate(Date statDate) {
		this.statDate = statDate;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Length(min = 0, max = 100, message = "NCM人员姓名长度必须介于 0 和 100 之间")
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public Office getOffice() {
		return office;
	}

	public void setOffice(Office office) {
		this.office = office;
	}

	@Length(min = 1, max = 50, message = "呼叫中心坐席ID长度必须介于 1 和 50 之间")
	public String getCallingId() {
		return callingId;
	}

	public void setCallingId(String callingId) {
		this.callingId = callingId;
		if (callingId != null && !"".equals(callingId) && callingId.length() > 12) {
			shortId = callingId.substring(12,callingId.length());
		}
	}

	@Length(min = 0, max = 30, message = "呼叫中心服务ID长度必须介于 0 和 30 之间")
	public String getServiceId() {
		return serviceId;
	}

	public void setServiceId(String serviceId) {
		this.serviceId = serviceId;
	}

	@Length(min = 1, max = 6, message = "呼叫中心企业ID长度必须介于 1 和 6 之间")
	public String getVccid() {
		return vccid;
	}

	public void setVccid(String vccid) {
		this.vccid = vccid;
	}

	public Long getBusyTime() {
		return busyTime;
	}

	public void setBusyTime(Long busyTime) {
		this.busyTime = busyTime;
	}

	public Long getFreeTime() {
		return freeTime;
	}

	public void setFreeTime(Long freeTime) {
		this.freeTime = freeTime;
	}

	public Long getCallCount() {
		return callCount;
	}

	public void setCallCount(Long callCount) {
		this.callCount = callCount;
	}

	public Long getCallTime() {
		return callTime;
	}

	public void setCallTime(Long callTime) {
		this.callTime = callTime;
	}

	public Long getSuccessCallCount() {
		return successCallCount;
	}

	public void setSuccessCallCount(Long successCallCount) {
		this.successCallCount = successCallCount;
	}

	public Long getSuccessCallTime() {
		return successCallTime;
	}

	public void setSuccessCallTime(Long successCallTime) {
		this.successCallTime = successCallTime;
	}

	public Double getSuccessCallRate() {
		return successCallRate;
	}

	public void setSuccessCallRate(Double successCallRate) {
		this.successCallRate = successCallRate;
	}

	public Long getCallTimeAvg() {
		return callTimeAvg;
	}

	public void setCallTimeAvg(Long callTimeAvg) {
		this.callTimeAvg = callTimeAvg;
	}

	public Long getSuccessCallTimeAvg() {
		return successCallTimeAvg;
	}

	public void setSuccessCallTimeAvg(Long successCallTimeAvg) {
		this.successCallTimeAvg = successCallTimeAvg;
	}

	public Long getRingTime() {
		return ringTime;
	}

	public void setRingTime(Long ringTime) {
		this.ringTime = ringTime;
	}

	public Long getRingCount() {
		return ringCount;
	}

	public void setRingCount(Long ringCount) {
		this.ringCount = ringCount;
	}

	public Long getRingAvgTime() {
		return ringAvgTime;
	}

	public void setRingAvgTime(Long ringAvgTime) {
		this.ringAvgTime = ringAvgTime;
	}

	public Long getCallMaxTime() {
		return callMaxTime;
	}

	public void setCallMaxTime(Long callMaxTime) {
		this.callMaxTime = callMaxTime;
	}

	public Long getCallQuickCount() {
		return callQuickCount;
	}

	public void setCallQuickCount(Long callQuickCount) {
		this.callQuickCount = callQuickCount;
	}

	public Long getCallLongCount() {
		return callLongCount;
	}

	public void setCallLongCount(Long callLongCount) {
		this.callLongCount = callLongCount;
	}

	public Long getQueueTime() {
		return queueTime;
	}

	public void setQueueTime(Long queueTime) {
		this.queueTime = queueTime;
	}

	public Long getSCalled() {
		return sCalled;
	}

	public void setSCalled(Long sCalled) {
		this.sCalled = sCalled;
	}

	public Long getCCalled() {
		return cCalled;
	}

	public void setCCalled(Long cCalled) {
		this.cCalled = cCalled;
	}

	@Length(min = 1, max = 2, message = "统计类型1全时间统计2工作时间统计长度必须介于 1 和 2 之间")
	public String getStatType() {
		return statType;
	}

	public void setStatType(String statType) {
		this.statType = statType;
	}

	public String getShortId() {
		return shortId;
	}

}